﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace School.WebPages.Research
{
    public partial class Platform : System.Web.UI.Page
    {
        TechnologySchoolEntities db = new TechnologySchoolEntities();
        protected string categoryStr = string.Empty;
        protected string parentCategoryStr = string.Empty;

        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = "科研平台";

            byte category = byte.Parse(Request.QueryString["categories"]);
            categoryStr = category.ToString();
            parentCategoryStr = Request.QueryString["parentCategory"];

            /*if (!Page.IsPostBack)
            {
                int glgc_totalArticles = db.Article.Where(a => a.SubMenu.Categories == 45).Count();
                anp_glgc.RecordCount = glgc_totalArticles;
                glgc_BindData();

                int zxqy_totalArticles = db.Article.Where(a => a.SubMenu.Categories == 46).Count();
                anp_zxqy.RecordCount = zxqy_totalArticles;
                zxqy_BindData();

                int cxkcx_totalArticles = db.Article.Where(a => a.SubMenu.Categories == 47).Count();
                anp_cxkcx.RecordCount = cxkcx_totalArticles;
                cxkcx_BindData();

                int hyjj_totalArticles = db.Article.Where(a => a.SubMenu.Categories == 48).Count();
                anp_hyjj.RecordCount = hyjj_totalArticles;
                hyjj_BindData();
            }*/

        }

        /*private void glgc_BindData()
        {
            rep_glgc.DataSource = DAL.PagerHelper.GetPagerData("Article", "ArticleID,Title,UpdateTime", "UpdateTime",
                anp_glgc.PageSize, anp_glgc.CurrentPageIndex, "Categories=45 and IsChecked=1");
            rep_glgc.DataBind();
        }

        protected void anp_glgc_PageChanged(object sender, EventArgs e)
        {
            glgc_BindData();
        }

        private void zxqy_BindData()
        {
            rep_zxqy.DataSource = DAL.PagerHelper.GetPagerData("Article", "ArticleID,Title,UpdateTime", "UpdateTime",
                anp_zxqy.PageSize, anp_zxqy.CurrentPageIndex, "Categories=46 and IsChecked=1");
            rep_zxqy.DataBind();
        }

        protected void anp_zxqy_PageChanged(object sender, EventArgs e)
        {
            zxqy_BindData();
        }

        private void cxkcx_BindData()
        {
            rep_cxkcx.DataSource = DAL.PagerHelper.GetPagerData("Article", "ArticleID,Title,UpdateTime", "UpdateTime",
                anp_cxkcx.PageSize, anp_cxkcx.CurrentPageIndex, "Categories=47 and IsChecked=1");
            rep_cxkcx.DataBind();
        }

        protected void anp_cxkcx_PageChanged(object sender, EventArgs e)
        {
            cxkcx_BindData();
        }

        private void hyjj_BindData()
        {
            rep_hyjj.DataSource = DAL.PagerHelper.GetPagerData("Article", "ArticleID,Title,UpdateTime", "UpdateTime",
                anp_hyjj.PageSize, anp_hyjj.CurrentPageIndex, "Categories=48 and IsChecked=1");
            rep_hyjj.DataBind();
        }

        protected void anp_hyjj_PageChanged(object sender, EventArgs e)
        {
            hyjj_BindData();
        }*/
    }
}
